package controller

type Controller struct {
	Page     int
	PageSize int
}

var BaseController = &Controller{}

type Pagination struct {
	List       interface{} `json:"list"`
	Page       int         `json:"page"`
	PageSize   int         `json:"page_size"`
	TotalCount int64       `json:"total_count"`
}

func (r *Controller) ParsePage(page, pageSize int) {
	if page <= 0 {
		page = 1
	}
	if pageSize <= 0 {
		pageSize = 8
	}
	if pageSize > 1000 {
		pageSize = 1000
	}
	r.Page = page
	r.PageSize = pageSize
}
